<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>WISSC轮滑教培服务网-查询系统</title>
	<#assign base=request.contextPath  />
    <link rel="icon" href="${base}/favicon.ico">
    <link rel="stylesheet" href="${base}/frame/layui/css/layui.css">
    <script src="${base}/frame/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${base}/js/ztree/jquery-1.4.4.min.js"></script>
    <script src="${base}/js/jquery.min.js"></script>
    <script type="text/javascript" src="${base}/js/feng.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/css/hzw-city-picker.css">
    <script type="text/javascript" src="${base}/js/city-data.js"></script>
    <script type="text/javascript" src="${base}/js/hzw-city-picker.min.js"></script>
</head>
<body>
<form class="layui-form" action="" style="margin: 10px">
    <div class="layui-form-item">
        <input type="hidden" id="id" value="${model!''}"/>

        <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label"><a style="color:red">*</a>&nbsp;用户名</label>
            <div class="layui-input-inline">
                <input name="username" id="username" lay-verify="required" autocomplete="off" class="layui-input isNull"
                       type="text">
            </div>
        </div>
<div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label"><a style="color:red">*</a>&nbsp;密码</label>
            <div class="layui-input-inline">
                <input name="password" id="password" lay-verify="required" autocomplete="off" class="layui-input isNull"
                       type="text">
            </div>
        </div>
        <div>
    </div>
        <div class="layui-form-item" style="text-align:center">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo" type="button"
                        onclick="onSubmit()" style="background-color: #0092EF;">立即提交
                </button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
</form>


    <script type="text/javascript">

        layui.use(['form', 'layedit', 'laydate','layer'], function(){
            var form = layui.form
                    ,layer = layui.layer
                    ,layedit = layui.layedit
                    ,laydate = layui.laydate;



        });

    </script>
<script>
    //编辑
    function onSubmit() {

        var jsonDate = {};
        jsonDate.username = $("#username").val();
        jsonDate.password = $("#password").val();
        jsonDate.id = $("#id").val();
        $.ajax({
            type:"POST",
            contentType: "application/json;charset=UTF-8",
            url:"${base}/user/updateUser",
            data:JSON.stringify(jsonDate),
            success:function(data){
               // alert(JSON.stringify(data))
                    layer.msg("修改成功");
                    setTimeout(function(){
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭

                    },300)
                var table = parent.layui.table;
                //表刷新方法
                table.reload('testReload', {
                    url: '${base}/user/selectMyPage'//数据接口
                    , where: {} //设定异步数据接口的额外参数
                    //,height: 300
                });

            }

        });

/*alert(1)
        window.onload=aa();
function aa() {
    window.location.href = "${base}/user/bootstrap.html"
}*/


    }


</script>

</body>
</html>
